<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <!-- SEO -->
        <title>Plateforme des stages - Miage Nice</title>

        <!-- THEME -->
        <!--[if IE]><link rel="stylesheet" href="<?php echo URL . STYLE; ?>css/ie.css" type="text/css" media="screen, projection"><![endif]-->
        <link rel="stylesheet" href="<?php echo URL . STYLE; ?>style.css" type="text/css" media="screen" />

        <!-- JQUERY -->
        <script src="<?php echo URL; ?>js/jquery-1.5.1.min.js" type="text/javascript"></script>
        <!-- JQUERY UI -->
        <script src="<?php echo URL; ?>js/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
        <link rel="stylesheet" href="<?php echo URL; ?>js/south-street/jquery-ui-1.8.11.custom.css" type="text/css" media="screen" />

        <!-- PLUGINS -->
        <!-- JCAROUSEL -->
        <script src="<?php echo URL; ?>js/lib/jquery.jCarousel.lite.js" type="text/javascript"></script>
        <!-- STEPSY -->
        <?php if (isset($_GET['m']) && (
                    strpos($_GET['m'], "submit_offre") !== false ||
                    strpos($_GET['m'], "profil_tuteur_enseignant") !== false ||
                    strpos($_GET['m'], "currentStages_tuteur_enseignant") !== false)
                ): ?>
            <script src="<?php echo URL; ?>js/lib/stepy/jquery.stepy.min.js" type="text/javascript"></script>
            <link rel="stylesheet" href="<?php echo URL; ?>js/lib/stepy/css/jquery.stepy.css" type="text/css" media="screen" />
        <?php endif; ?>

        <!-- JHTMLAREA -->
        <script type="text/javascript" src="<?php echo URL; ?>js/lib/jHtmlArea/scripts/jHtmlArea-0.7.0.js"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo URL; ?>js/lib/jHtmlArea/style/jHtmlArea.css" />

        <!-- SCROLLTO -->
        <script type="text/javascript" src="<?php echo URL; ?>js/lib/jquery.scrollTo.js"></script>

        <!-- PERSO -->
        <script src="<?php echo URL; ?>js/script.js" type="text/javascript"></script>
        <style>
            div.jHtmlArea div iframe{
                border:1px grey solid;
            } 
        </style>
    </head>
    <body>
    <script type="text/javascript">
    $(document).ready(function() {
        $("#loadingOffre").hide();
        $( ".datepicker" ).datepicker();

        $.datepicker.regional['fr'] = {
            clearText: 'Effacer', clearStatus: '',
            closeText: 'Fermer', closeStatus: 'Fermer sans modifier',
            prevText: '&lt;Pr&eacute;c', prevStatus: 'Voir le mois pr&eacute;c&eacute;dent',
            nextText: 'Suiv&gt;', nextStatus: 'Voir le mois suivant',
            currentText: 'Courant', currentStatus: 'Voir le mois courant',
            monthNames: ['Janvier','F&eacute;vrier','Mars','Avril','Mai','Juin',
            'Juillet','Ao&ucirc;t','Septembre','Octobre','Novembre','D&eacute;cembre'],
            monthNamesShort: ['Jan','F&eacute;v','Mar','Avr','Mai','Jun',
            'Jul','Ao&ucirc;','Sep','Oct','Nov','D&eacute;c'],
            monthStatus: 'Voir un autre mois', yearStatus: 'Voir une autre ann&eacute;e',
            weekHeader: 'Sm', weekStatus: '',
            dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
            dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
            dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
            dayStatus: 'Utiliser DD comme premier jour de la semaine', dateStatus: 'Choisir le DD, MM d',
            dateFormat: 'dd/mm/yy', firstDay: 0,
            initStatus: 'Choisir la date', isRTL: false
        };
        $.datepicker.setDefaults($.datepicker.regional['fr']);
        $("textarea").htmlarea({toolbar: ["bold", "italic", "underline","|","link", "unlink","|","orderedList","unorderedList","|","p","h3","h4","|","indent","outdent"]});
        <?php if (!isConnected()): ?>
        $("#proc_login").keyup(function(event){
            if(event.keyCode == 13)
            {
                $("#form-login").submit();
            }
        });
        $("#proc_password").keyup(function(event){
            if(event.keyCode == 13){
                $("#form-login").submit();
            }
        });
        <?php endif; ?>

        <?php if (isset($_GET['m']) && (
                strpos($_GET['m'], "submit_offre") !== false ||
                strpos($_GET['m'], "profil_tuteur_enseignant") !== false ||
                strpos($_GET['m'], "currentStages_tuteur_enseignant") !== false)
                ): ?>
        $('#custom').stepy({
            backLabel:      'Pr&eacute;c&eacute;dente',
            block:          true,
            errorImage:     true,
            nextLabel:      'Suivante',
            titleClick:     true
        });
        <?php endif; ?>
        <?php if (isset($_GET['m']) && (strpos($_GET['m'], "stage") !== false)): ?>
        $(".tab_content").hide(); //Hide all content
        var url = window.location.href;
        var tab = url.split('#');
        if(tab[1])
        {
            var ong = tab[1].split("b");
            if(ong[1])
            {
                // ACTIVE L'ONGLET DEMANDE
                $("ul.tabs li#ong"+ong[1]).addClass("active").show();
                $(".tab_container #tab"+ong[1]).show();
            }
            else
            {
                $("ul.tabs li:first").addClass("active").show(); //Activate first tab
                $(".tab_content:first").show(); //Show first tab content
            }
        }
        else
        {
            $("ul.tabs li:first").addClass("active").show(); //Activate first tab
            $(".tab_content:first").show(); //Show first tab content
        }
        //On Click Event
        $("ul.tabs li").click(function() {
            $("ul.tabs li").removeClass("active"); //Remove any "active" class
            $(this).addClass("active"); //Add "active" class to selected tab
            $(".tab_content").hide(); //Hide all tab content
            var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
            $(activeTab).fadeIn(); //Fade in the active ID content
            return false;
        });
        <?php endif; ?>
        <?php if (isConnected() && isset($_GET['m']) && !empty($_GET['m']) && $_GET['m'] == "offres"): ?>
            $("#moreResult").click(function(){
                if($("#pageResult").val() == "1")
                {
                    $("#pageResult").val(2);
                }
                ajax.getOffres();
            });
            $("#filtreOffre").change(function(){
                if($("#pageResult").val() != "1" && $("#isResearch").val() == "0")
                {
                    $("#pageResult").val(1);
                }
                $("#listOffres").html("");
                ajax.getOffres();
            });
            $("#searchOffre").click(function(){
                if($("#pageResult").val() != "1" && $("#isResearch").val() == "0")
                {
                    $("#pageResult").val(1);
                }
                $("#listOffres").html("");
                ajax.getOffres();
            });
        <?php endif; ?>
    });
    </script>
    <div id="wrapper">
        <div id="container" class="container">
        <div id="header" class="span-24">
            <?php if (isConnected ()): ?>
            <div class="span-24">
                <div id="pagemenucontainer">
                    <ul id="pagemenu">
                        <?php if (isEtudiant ()): ?>
                            <li <?php if(isset($_GET['m']) && strpos($_GET['m'], "profil_etudiant") !== false){echo 'class="current_page_item"';}?>>
                                <a href="<?php echo URL; ?>index.php?m=profil_etudiant">Mon profil</a>
                            </li>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "stage_etudiant") !== false){echo 'class="current_page_item"';} ?>>
                                <a href="<?php echo URL; ?>index.php?m=stage_etudiant">Mes Fiches et Conventions</a>
                            </li>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "submit_offre") !== false){echo 'class="current_page_item"';} ?>>
                                <a href="<?php echo URL; ?>index.php?m=submit_offre">Soumettre Fiche de stage</a>
                            </li>
                        <?php endif; ?>
                        <?php if (isEnseignant()):?>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "profil_tuteur_enseignant") !== false){echo 'class="current_page_item"';} ?>>
                                <a href="<?php echo URL; ?>index.php?m=profil_tuteur_enseignant">Mon profil</a>
                            </li>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "currentStages_tuteur_enseignant") !== false){echo 'class="current_page_item"';}?>>
                                <a href="<?php echo URL; ?>index.php?m=currentStages_tuteur_enseignant">Mes stages en cours</a>
                            </li>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "pastStages_tuteur_enseignant") !== false){echo 'class="current_page_item"';}?>>
                                <a href="<?php echo URL; ?>index.php?m=pastStages_tuteur_enseignant">Mes stages termin&eacute;s</a>
                            </li>
                        <?php endif; ?>
                        <?php if (isEntreprise ()): ?>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "app_entreprise_proposeroffre") !== false){echo 'class="current_page_item"';} ?>>
                                <a href="<?php echo URL; ?>index.php?m=app_entreprise_proposeroffre">Proposer une offre</a>
                            </li>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "app_entreprise_historiqueoffre") !== false){echo 'class="current_page_item"';} ?>>
                                <a href="<?php echo URL; ?>index.php?m=app_entreprise_historiqueoffre">Historique des offres</a>
                            </li>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "app_entreprise_gestionprofil") !== false){echo 'class="current_page_item"';} ?>>
                                <a href="<?php echo URL; ?>index.php?m=app_entreprise_gestionprofil">Profil personnel</a>
                            </li>
                            <li <?php if (isset($_GET['m']) && strpos($_GET['m'], "app_entreprise_gestionprofilentreprise") !== false){echo 'class="current_page_item"';} ?>>
                                <a href="<?php echo URL; ?>index.php?m=app_entreprise_gestionprofilentreprise">Profil entreprise</a>
                            </li>
                            <?php if(isTuteurEntreprise()): ?>
                            <li>
                                <a href="<?php echo URL; ?>index.php?m=tuteur_entreprise_stage">Mes stages</a>
                            </li>
                            <?php endif; ?>
                        <?php endif; ?>
                        <?php if (isAdministrateur () || isResponsable()): ?>
                            <li>
                                <a href="<?php echo URL; ?>index.php?m=admin">Admin</a>
                            </li>
                        <?php endif; ?>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            <?php endif; ?>
            <div class="span-12">
                <a href="<?php echo URL; ?>" class="title">
                    <h1>Plateforme de gestion des stages</h1>
                </a>
                <a href="<?php echo URL; ?>" class="right">
                    <img src="<?php echo DS . STYLE; ?>images/logo-miage.png" alt="Logo Miage" title="Gestion des stages" class="logoimg" />
                </a>
            </div>
            <div class="span-12 last" style="padding-top: 5px; text-align:right;"></div>
        </div>